#include<iostream>
#include<string>
#include"contacts.pb.h"


int main()
{
    contacts::PeopleInfo info;
    info.set_age(18);
    info.set_name("zhangsan");
    info.set_score(80);

    std::string outbuffer;
    if(!info.SerializeToString(&outbuffer))
    {
        std::cout<<"SerializeToString error"<<std::endl;
    }
    
    contacts::PeopleInfo people;
    if(!people.ParseFromString(outbuffer))
    {
        std::cout<<"反序列化失败"<<std::endl;
    }

    std::cout<<people.age()<<std::endl;
    std::cout<<people.name()<<std::endl;
    std::cout<<people.score()<<std::endl;   

    

    return 0;
}